<?php require_once('../Connections/miportal.php');
mysql_query("SET NAMES 'utf8'"); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") 
{
  if (PHP_VERSION < 6) {
    $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
  }

  $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);

  switch ($theType) {
    case "text":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;    
    case "long":
    case "int":
      $theValue = ($theValue != "") ? intval($theValue) : "NULL";
      break;
    case "double":
      $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
      break;
    case "date":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;
    case "defined":
      $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
      break;
  }
  return $theValue;
}
}

mysql_select_db($database_miportal, $miportal);
$query_rs_corte02 = "SELECT DISTINCT usuario.`nmb_target`,usuario.`nmb_titulo`, usuario.`nmb_nombres`, usuario.`nmb_apaterno`, usuario.`nmb_amaterno`, usuario.`inf_correo_p`,usuario.`inf_telefono_oficina`,usuario.`inf_extension`, COUNT(candidato.id_cat_ies) AS COUNT,
(select COUNT(*) from cor_candidato WHERE id_convocatoria_activa=17 AND cor_candidato.id_cat_ies=usuario.id_target) AS CAND_VB,
(select COUNT(*) from cor_candidato WHERE id_convocatoria_activa=17 AND cor_candidato.id_cat_ies=usuario.id_target AND cor_candidato.tp_stat_registro='COMPLETO') AS COMP_VB,
(select COUNT(*) from cor_candidato WHERE id_convocatoria_activa=18 AND cor_candidato.id_cat_ies=usuario.id_target) AS CAND_EXP,
(select COUNT(*) from cor_candidato WHERE id_convocatoria_activa=18 AND cor_candidato.id_cat_ies=usuario.id_target AND cor_candidato.tp_stat_registro='COMPLETO') AS COMP_EXP,
(select COUNT(*) from cor_candidato WHERE id_convocatoria_activa=19 AND cor_candidato.id_cat_ies=usuario.id_target) AS CAND_EMP,
(select COUNT(*) from cor_candidato WHERE id_convocatoria_activa=19 AND cor_candidato.id_cat_ies=usuario.id_target AND cor_candidato.tp_stat_registro='COMPLETO') AS COMP_EMP,
(select COUNT(*) from cor_candidato WHERE id_convocatoria_activa=20 AND cor_candidato.id_cat_ies=usuario.id_target) AS CAND_MPE,
(select COUNT(*) from cor_candidato WHERE id_convocatoria_activa=20 AND cor_candidato.id_cat_ies=usuario.id_target AND cor_candidato.tp_stat_registro='COMPLETO') AS COMP_MPE
FROM cat2_usuario AS usuario  LEFT JOIN cor_candidato AS candidato ON(usuario.id_target=candidato.id_cat_ies) WHERE usuario.tp_perfil='RIV'  AND usuario.tp_validacion=11 GROUP BY usuario.id_target";
$rs_corte02 = mysql_query($query_rs_corte02, $miportal) or die(mysql_error());
$row_rs_corte02 = mysql_fetch_assoc($rs_corte02);
$totalRows_rs_corte02 = mysql_num_rows($rs_corte02);
?>

<!DOCTYPE html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximun-scale=1">
<title>FUNDACIÓN EDUCACIÓN SUPERIOR-EMPRESA</title>
<!--Hoja de estilo principal-->
<link href="../css/styletd2.css" rel="stylesheet" type="text/css">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<link rel="shortcut icon" href="stylesheet/img/devil-icon.png"> 
<link rel="stylesheet" type="text/css" href="../css/mos-style.css">
<link rel="stylesheet" type="text/css" href="../css/menu.css"><!--Pemanggilan gambar favicon-->
 <!--pemanggilan file css-->
<script src="../SpryAssets/SpryValidationTextField.js" type="text/javascript"></script>
<script language=""="JavaScript">
	function confirmar ( mensaje ) {
					return confirm( mensaje );
				}
        </script>
<link href="../SpryAssets/SpryValidationTextField.css" rel="stylesheet" type="text/css">
</head>
<body>
 <header>
    <div id="background"></div><!--BackGround Menu header-->
		<div class="img_header_logo"></div>
		<span class="img_header_logo"><a href="http://fese.org.mx"><img src="../images/fese/FESE_home_logo.png"  height="90" alt="FESE" align="bottom" /></a></span>
		<div class="img_header_logo"></div>
		
        <div id="nav">
		<ul>
		  <li class="nivel1"><a href="http://fese.org.mx/" class="nivel1">Salir</a></li>		 
		</ul>
</div><!--Menu NAV-->
        
        
</header>
<center>
<div id="boxcontainer">
<div id="container">
  
 <p>&nbsp;</p>
 <table width="139%" border="1">   
      <th class="data" scope="col">IES</th>
      <th class="data" scope="col">NOMBRE RIV</th>
      <th class="data" scope="col">TOTAL</th>
      <th class="data" scope="col">BV</th>
      <th class="data" scope="col">EXP</th>
      <th class="data" scope="col">EMP</th>
      <th class="data" scope="col">MPE</th>
   <?php do { ?>
   
   <tr>
     <td class="data"><?php echo $row_rs_corte02['nmb_target']; ?></td>
     <td class="data"><?php echo $row_rs_corte02['nmb_titulo']; ?><?php echo $row_rs_corte02['nmb_nombres']; ?> <?php echo $row_rs_corte02['nmb_apaterno']; ?></td>
     <td class="data"><?php echo $row_rs_corte02['COUNT']; ?></td>
     <td class="data"><?php echo $row_rs_corte02['CAND_VB']; ?></td>
     <td class="data"><?php echo $row_rs_corte02['CAND_EXP']; ?></td>
     <td class="data"><?php echo $row_rs_corte02['CAND_EMP']; ?></td>
     <td class="data"><?php echo $row_rs_corte02['CAND_MPE']; ?></td>
     
     
     </tr>
     <?php } while ($row_rs_corte02 = mysql_fetch_assoc($rs_corte02)); ?>
 </table>
<p>&nbsp;</p>
<p>&nbsp;</p>
  <p>&nbsp;</p>
  <div id="dinamicContaint">
  
  </div><!--dinamicContaint-->
  <p>&nbsp;</p>
</div><!--Container-->



</div><!--Boxcontainer-->
</center>
  
  
</body>
</html><?php
mysql_free_result($rs_corte02);
?>
